<%
var headContent = {
include("/pages/template/head.html"){}
%>

<script type="text/javascript">
jQuery(function () {
 // 时间设置
   $('#timepicker1').datetimepicker({
        showSecond : true,
		timeFormat : 'HH:mm:ss',
		stepHour : 1,
		stepMinute : 1,
		stepSecond : 1
            });
	$("#timepicker2").datetimepicker({
		showSecond : true,
		timeFormat : 'HH:mm:ss',
		stepHour : 1,
		stepMinute : 1,
		stepSecond : 1
	});
});


    var oper;
    jQuery(function($) {
        // 页面方法
        oper = {
            width : 450,
            height : 500,
            form : document.cusform,
            list : function() {
                var url = 'system/orderinfo/queryListForCus';
                this.form.action = url;
                this.form.submit();
            },
            orderinfoForCusExport : function() {
            	if(!validForm()) {
		                return;
		         }
                var url = 'system/export/orderinfoForCusExport';
                this.form.action = url;
                this.form.submit();
            },
            view : function(id) {
                var url = 'system/orderinfo/getCusView/'+id;
                var title = '查看订单信息';
                Iframe(url, this.width, this.height, title, false, false, false, EmptyFunc);
            }
        };
        //显示Menu索引
        showMenu('page_system');
        showMenu('page_customerinfo');
    });

    //分页
    var paginator = function(page) {
        oper.list();
    };

</script>

<%
};

var bodyContent = {
%>
<form name="cusform" action="" method="post"  class="form-inline" role="form">
	<!-- 菜单 -->
	<% include("/pages/template/menu.html"){} %>

	<div class="tableSearch">
		<%  //查询列表 %>
		<div class="form-group">
			<input class="form-control" type="text" name="attr.orderNo" value="${attr.orderNo!''}"
				   placeholder="请输入订单号"  />
		</div>
		<div class="form-group">
			<input class="form-control" type="text" name="attr.phoneNo" value="${attr.phoneNo!''}"
				   placeholder="请输入手机号"  />
		</div>

		<div class="form-group">
		 	<select name="attr.operator" class="form-control" style ="width:196px;" >
				<option value="">   请选择运营商   </option>
				<option value="1" ${attr.operator=="1"?"selected":"" }>电信</option>
				<option value="2" ${attr.operator=="2"?"selected":"" }>移动</option>
				<option value="3" ${attr.operator=="3"?"selected":"" }>联通</option>
			</select>
		</div>
		<div class="form-group">
		 	<select name="attr.status" class="form-control" style ="width:196px;" >
				<option value="">   请选择订单状态   </option>
				<option value="0" ${attr.operator=="0"?"status":"" }>受理中</option>
				<option value="1" ${attr.operator=="1"?"status":"" }>订购中</option>
				<option value="7" ${attr.operator=="7"?"status":"" }>订购成功</option>
				<option value="8" ${attr.operator=="8"?"status":"" }>订购失败</option>
			</select>
		</div>
		
			<div class="form-group">
			<input id = "timepicker1" class="form-control" type="text" name="startTime" value="${startTime!""}" valid="vtext" validname="开始时间" 
				   placeholder="请输入开始时间" required='required' readonly="true"  />
		</div>
		
		<div class="form-group">
			<input id = "timepicker2" class="form-control" type="text" name="endTime" value="${endTime!""}"  valid="vtext"  validname="结束时间" 
				   placeholder="请输入结束时间" required='required' readonly="true" />
		</div>
		
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<button type="button" class="btn btn-default" onclick="oper.orderinfoForCusExport();">
			<span class="glyphicon glyphicon-log-out"></span> 导 出
		</button>
		<button type="button" class="btn btn-default" onclick="resetForm();">
			<span class="glyphicon glyphicon-refresh"></span> 重 置
		</button>
			<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			<span class="glyphicon glyphicon-search"></span> 查 询
		</button>
	</div>

	<!-- 数据列表 -->
	<table class="table table-striped table-bordered table-hover">
		<thead>
		<tr>
			<th>序号</th>
			<%  // 列表头部 %>
			<th style="display:none" name="ids" class="sorting">ids</th>
			<th name="orderNo" class="sorting">订单号</th>
			<th name="phoneNo" class="sorting">手机号</th>
			<th name="vasProdName" class="sorting">商品名称</th>
			<th name="sellPrice" class="sorting">订单金额(元)</th>
			<th name="orderTime" class="sorting">订购时间</th>
			<th name="openTime" class="sorting">开通时间</th>
			<th name="status" class="sorting">订单状态</th>
			<th name="isPay" class="sorting">计费状态</th>
			<th name="currentAmount" class="sorting">当前余额</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		<% for(item in page.list){ %>
		<tr>
			<td>${itemLP.index }</td>
			<%  // 列表内容 %>
			<td>${item.orderNo}</td>
			<td>${item.phoneNo}</td>
			<td>${item.vasProdName}</td>
			<td>${item.sellPrice}</td>
			<td>${item.orderTime}</td>
			<td>${item.openTime}</td>
			<td>
				<% if(item.status=="1") { %>
				<span class ="font-success">订购中</span>
				<%	} %>
				<% if(item.status=="0") { %>
				<span class ="font-success">受理中</span>
				<%	} %>
				<% if(item.status=="7") { %>
				<span class ="font-success">订购成功</span>
				<%	} %>
				<% if(item.status=="8") { %>
				<span class ="font-danger">订购失败</span>
				<%	} %>
			</td>
			<td>
				<% if(item.isPay=="1") { %>
				<span class ="font-danger">系统退费</span>
				<%	} %>
				<% if(item.isPay=="0") { %>
				<span class ="font-success">系统扣费</span>
				<%	} %>
				<% if(item.isPay=="2") { %>
				<span class ="font-success">退款成功</span>
				<%	} %>
				<% if(item.isPay=="3") { %>
				<span class ="font-danger">退款失败</span>
				<%	} %>
			</td>
			<td>${item.currentAmount}</td>
			<td>
				<a href="javascript:void(0);" class="btn btn-sm btn-success" onclick="oper.view('${item.ids}');">查看</a>
			</td>
		</tr>
		<% } %>
		</tbody>
	</table>
	<%include("/pages/includes/paginator.html"){} %>
</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>